package io.web.gateway.mock;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Collections;
import java.util.Map;

/**
 * MockApplication.
 *
 * @date 2023-05-29
 */
@SpringBootApplication
@RestController
public class MockApplication {
    public static void main(String[] args) {
        SpringApplication.run(MockApplication.class, args);
    }

    @GetMapping("/")
    public String path(HttpServletRequest request) {
//        int i = 1 / 0;
        return "path";
    }


    @GetMapping("/path1")
    public String path1() {
        return "path1";
    }

    @GetMapping("/path2")
    public String path2() {
        return "path2";
    }

    @GetMapping("/path3")
    public Map<String, Object> path3(HttpServletRequest request) {
        return Collections.singletonMap("path", "path3");
    }
}
